package com.geo.smallcredit.dialog.widget;

import com.geo.smallcredit.R;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.TextView;

public class ConfirmDialog extends Dialog {
	
    private TextView txtContent;
    private Button positiveButton, negativeButton;
    private TextView txtTitle;
 
    public ConfirmDialog(Context context) {
        super(context);
        setCustomDialog();
    }
    
    public ConfirmDialog(Context context, int theme) {
    	super(context, theme);
    	setCustomDialog();
    }
 
    @SuppressLint("InflateParams")
	private void setCustomDialog() {
        View mView = LayoutInflater.from(getContext()).inflate(R.layout.ui_confirm_dlg, null);
        txtTitle = (TextView) mView.findViewById(R.id.title);
        txtContent = (TextView) mView.findViewById(R.id.content);
        positiveButton = (Button) mView.findViewById(R.id.positiveButton);
        negativeButton = (Button) mView.findViewById(R.id.negativeButton);
        super.setContentView(mView);
    }
    
    public void setContent(String cnt) {
    	txtContent.setText(cnt);
    }
    
    public void setTitle(String title) {
    	txtTitle.setText(title);
    }
    
    @Override
    public void setContentView(int layoutResID) {    	
    }

    @Override
    public void setContentView(View view, LayoutParams params) {
    }
 
    @Override
    public void setContentView(View view) {
    }

    public void setOnPositiveListener(View.OnClickListener listener){ 
        positiveButton.setOnClickListener(listener); 
    }

    public void setOnNegativeListener(View.OnClickListener listener){ 
        negativeButton.setOnClickListener(listener); 
    }
}